package br.com.mural.entidades;

import java.util.HashMap;
import java.util.Map;

import javax.persistence.Column;
import javax.persistence.ElementCollection;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinTable;
import javax.persistence.ManyToOne;
import javax.persistence.MapKeyColumn;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

@Entity
@Table(name = "AVALIACAO")
@XmlRootElement
public class Avaliacao {
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private int id;

	@ElementCollection
	@JoinTable(name = "AVALIACAO_RESPOSTA")
	@MapKeyColumn(name = "PERGUNTA")
	@Column(name = "RESPOSTA")
	private Map<String, String> avaliacoes = new HashMap<String, String>();
	@ManyToOne
	private Questionario questionario;

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public Map<String, String> getAvaliacoes() {
		return avaliacoes;
	}

	public void setAvaliacoes(Map<String, String> avaliacoes) {
		this.avaliacoes = avaliacoes;
	}

	public Questionario getQuestionario() {
		return questionario;
	}

	public void setQuestionario(Questionario questionario) {
		this.questionario = questionario;
	}

}
